﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="WorkSoultion.aspx.cs" Inherits="Page_日常工作_WorkSoultion" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="/Com/JS/easyUi/themes/icon.css" rel="stylesheet" />
    <link href="/Com/JS/easyUi/themes/default/easyui.css" rel="stylesheet" />
    <link href="/Com/JS/formValidator/css/template.css" rel="stylesheet" />
    <link href="/Com/JS/formValidator/css/validationEngine.jquery.css" rel="stylesheet" />
    <link href="/Com/CSS/default.css" rel="stylesheet" />
    <script src="/Com/JS/jquery-1.8.2.js"></script>
    <script src="/Com/JS/easyUi/jquery.easyui.min.js"></script>
    <script src="/Com/JS/Common.js"></script>
    <script src="/Com/JS/jquery.form.js"></script>
    <script src="/Com/JS/formValidator/js/jquery.validationEngine.js"></script>
    <script src="/Com/JS/formValidator/js/languages/jquery.validationEngine-zh_CN.js"></script>
    <%--layui--%>
    <link href="../../Com/layui/css/layui.css" rel="stylesheet" />
    <script src="../../Com/layui/layui.js"></script>
    <script type="text/javascript">
        $().ready(function () {
            var option = {
                iconCls: 'icon-save',
                idField: 'IDPlus',
                nowrap: false,
                fit: true,
                striped: true,
                useRp: true,
                pageList: [1, 10, 15, 20],
                pageSize: 10,
                url: '/Handler/SoultionHandler.ashx?action=GetWorkSoultionTable',
                loadMsg: '数据装载中......',
                sortName: 'AddTime',
                sortOrder: 'desc',
                queryParams: {},
                singleSelect: true,
                columns: [[
                    {
                        title: "操作",
                        field: "opt",
                        width: 160,
                        align: 'center',
                        formatter: function (value, rowData, rowIndex) {
                            var strOption = "";
                            //strOption += '<a href="WorkSoultionDetial.aspx?id=' + rowData.Id + '" target="_blank" style="text-decoration:none;color:blue" >查看</a>&nbsp&nbsp';
                            strOption += '<a href="#" style="text-decoration:none;color:blue" onclick="Look(\'' + rowData.Id + '\');">查看</a>&nbsp&nbsp';
                            strOption += '<a href="#" style="text-decoration:none;color:blue" onclick="Edit(\'' + rowData.Id + '\');">修改</a>&nbsp&nbsp';
                            strOption += '<a href="#" style="text-decoration:none;color:blue" onclick="Delete(\'' + rowData.Id + '\');">删除</a>&nbsp&nbsp';
                            return strOption;
                        }
                    },
                    { title: '主键', field: 'Id', sortable: true, align: 'center', width: 120, hidden: true },
                    { title: '标题', field: 'Title', align: 'center', width: 300 },
                    { title: '问题类型', field: 'TypeName', align: 'center', width: 100 },
                    { title: '解决人', field: 'EmployeeName', align: 'center', width: 100 },
                    { title: '解决时间', field: 'AddTime', align: 'center', width: 100 }

                ]],
                pagination: true,
                rownumbers: true,
                toolbar: "#divToolBar",
                onSortColumn: function (sort, order) {
                    var queryParams = $('#dataList').datagrid('options').queryParams;
                    queryParams.SortName = sort;
                    queryParams.SortOrder = order;
                }
            };

            option.queryParams = { RP: option.pageSize };
            $("#dataList").datagrid(option);
            //分页实现
            var p = $('#dataList').datagrid('getPager');
            if (p) {
                $(p).pagination({
                    displayMsg: '当前显示从{from}到{to}共{total}记录',
                    beforePageText: "第",
                    afterPageText: "共 {pages}",
                    onBeforeRefresh: function (pageNumber, pageSize) {
                        $(this).pagination('loading');
                    },
                    onChangePageSize: function () {
                        var queryParams = $('#dataList').datagrid('options').queryParams;
                        queryParams.RP = $(p).pagination('options').pageSize;
                    },
                    onRefresh: function () {
                    },
                    onSelectPage: function (pageNumber, pageSize) {
                        var queryParams = $('#dataList').datagrid('options').queryParams;
                        queryParams.Page = pageNumber;
                        $("#dataList").datagrid('reload');
                    }
                });
            }
        });



        //表单提交前
        function showRequest(formData, jqForm, options) {
            return true;
        }
        //表单提交出错
        function showError(data) {
            alert('提交出错！');
        }

        //删除
        function Delete(idplus) {
            if (confirm("确定要删除吗？")) {
                $.get('/Handler/SoultionHandler.ashx?action=DeleteArticle&IDPlus=' + idplus, {}, function (data) {
                    var result = GetResult(data);
                    if (result.IsSuccess) {
                        alert(result.Message);
                        $("#dataList").datagrid("reload");
                    } else {
                        if (result.Message != "") {
                            alert(result.Message);
                        }
                    }
                });
            }
        }

        //查询
        function Query() {
            var search = "";
            $('#divToolBar').find(":selected,select,textarea,:hidden,:checkbox,:password").each(function () {
                search = search + this.id + "&" + this.value + "^";
            });
            $('#divToolBar').find(":input").each(function () {
                search = search + this.name + "&" + this.value + "^";
            });
            var queryParams = $('#dataList').datagrid('options').queryParams;
            $('#dataList').datagrid('options').page = 1;
            queryParams.Page = 1;
            queryParams.Query = search;
            var gp = $('#dataList').datagrid('getPager');
            if (gp) {
                gp.pagination('options').pageNumber = 1;
                gp.pagination('loading');
            }
            $("#dataList").datagrid('reload'); //刷新
        }

        //首页模块添加页面初始化
        function Add() {
            $("#dialogAddHomePageModule").dialog("open");
        }

        //添加
        function Add() {
            parent.addTab("问题反馈", '/Page/日常工作/WorkSoultionAdd.aspx', window, "WorkSoultionAdd");
        }

        //编辑
        function Edit(idplus) {
            parent.addTabUrl("修改问题", '/Page/日常工作/WorkSoultionEdit.aspx?IDPlus=' + idplus, window, "WorkSoultionEdit");
        }

        function Look(idplus) {
            parent.addTabUrl("查看问题", '/Page/日常工作/WorkSoultionDetial.aspx?IDPlus=' + idplus, window, "WorkSoultionEdit");
        }

    </script>

    <script>
        layui.use('laydate', function () {

            var laydate = layui.laydate;

            var start = {
                min: '2000-01-01 00:00:00'
              , max: '2099-06-16 23:59:59'
              , istoday: true
                //, istime: false
              , festival: true
              , choose: function (datas) {
                  end.min = datas; //开始日选好后，重置结束日的最小日期
                  end.start = datas //将结束日的初始值设定为开始日
              }

            };

            var end = {
                min: '2000-01-01 00:00:00'
              , max: '2099-06-16 23:59:59'
              , istoday: true
                , festival: true
              , choose: function (datas) {
                  start.max = datas; //结束日选好后，重置开始日的最大日期
              }
            };
            document.getElementById('LAY_demorange_s').onclick = function () {
                start.elem = this;
                laydate(start);

            }
            document.getElementById('LAY_demorange_e').onclick = function () {
                end.elem = this
                laydate(end);
            }

        });
    </script>
</head>
<body class="easyui-layout" style="height: 95%; overflow: hidden; border: none;">
    <div id="divToolBar" style="padding: 5px; height: auto">
        <div style="margin-bottom: 5px">
            <a href="#" class="easyui-linkbutton" iconcls="icon-add" plain="true" onclick="Add()">添加</a>
        </div>
        <div>
            <div class="layui-form-pane" style="margin-top: 15px;">
                <div class="layui-form-item">
                    <label class="layui-form-label" style="padding: 1px 15px;">范围选择：</label>
                    <div class="layui-input-inline">
                        <input class="inline laydate-icon" style="padding-left: 10px;" placeholder="开始日" id="LAY_demorange_s" name="txtStartDate" />
                    </div>
                    <div class="layui-input-inline">
                        <input class="inline laydate-icon" style="padding-left: 10px;" placeholder="截止日" id="LAY_demorange_e" name="txtEndDate" />
                    </div>

                    &nbsp
                   关键字：
            <input id="txtKeyWords" name="txtKeyWords" type="text" class="txt01" style="width: 100px;" />
                    &nbsp

            <a id="btnSearch" href="javascript:void(0);" iconcls="icon-search" class="easyui-linkbutton" onclick="Query()">查询</a>
                </div>
            </div>

        </div>
    </div>
    <div region="center" border="false" style="margin-left: 5px; margin-top: 3px">
        <table id="dataList">
        </table>
    </div>

</body>
</html>

